import { IsNotEmpty, IsMobilePhone, IsEmail, IsBoolean } from 'class-validator';
import { ApiModelProperty } from '@nestjs/swagger';

export class UpdateUserDto {
  @ApiModelProperty()
  @IsNotEmpty()
  id: string;

  @ApiModelProperty()
  @IsNotEmpty()
  readonly userName: string;

  @ApiModelProperty()
  @IsNotEmpty()
  password: string;

  @ApiModelProperty()
  @IsNotEmpty()
  confirmPassword: string;

  // 姓名
  @ApiModelProperty()
  @IsNotEmpty()
  readonly name: string;

  @ApiModelProperty()
  @IsMobilePhone('zh-CN')
  readonly phoneNum: string;

  @ApiModelProperty()
  @IsNotEmpty()
  @IsEmail()
  readonly email: string;

  // 头像
  @ApiModelProperty()
  readonly logo: string;

  // 备注
  @ApiModelProperty()
  readonly comments: string;

  // 用户组
  @ApiModelProperty()
  @IsNotEmpty()
  readonly group: string;

  // 是否有效
  @ApiModelProperty()
  @IsNotEmpty()
  @IsBoolean()
  readonly enable: boolean;
}
